<template>
    <div>
      <SellerHeader :seller="seller"></SellerHeader>
      <SellerList></SellerList>
      <router-view :goods="goods" :seller="seller" :ratings="ratings"></router-view>
    </div>
</template>

<script>
import SellerHeader from './components/SellerHeader.vue'
import SellerList from './components/SellerList.vue'
export default {
  name: 'Seller',
  components: {
    SellerHeader,
    SellerList
  },
  data () {
    return {
      seller: {},
      goods: [],
      ratings: []
    }
  },
  methods: {
    getData () {
      this.$axios.get('/api/seller.json').then((res) => {
        const data = res.data
        if (data.ret) {
          this.seller = data.seller
          this.goods = data.goods
          this.ratings = data.ratings
        }
      })
    }
  },
  mounted () {
    this.getData()
  }
}
</script>

<style lang='scss' scoped>
</style>
